package danny.tools.log;

import java.text.SimpleDateFormat;
import java.sql.Timestamp;
import java.util.Locale;

/**
 * @author Danny the log data pojo
 */
public class ParsedData {

	private String ip;

	private String time;

	private Timestamp formatedTime = null;

	private String requestMethod;

	private String refUrl;

	private String HTTPStatusCode;

	private String returnedObjectSize;

	private String clientStr;

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getTime() {

		return time;
	}

	public void setTime(String time) {

		this.time = time;
		SimpleDateFormat dfmt = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", Locale.ENGLISH);
		try {
			formatedTime = new Timestamp(dfmt.parse(time).getTime());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String getRequestMethod() {
		return requestMethod;
	}

	public void setRequestMethod(String requestMethod) {
		this.requestMethod = requestMethod;
	}

	public String getRefUrl() {
		return refUrl;
	}

	public void setRefUrl(String refUrl) {
		this.refUrl = refUrl;
	}

	public String getHTTPStatusCode() {
		return HTTPStatusCode;
	}

	public void setHTTPStatusCode(String statusCode) {
		HTTPStatusCode = statusCode;
	}

	public String getReturnedObjectSize() {
		return returnedObjectSize;
	}

	public void setReturnedObjectSize(String returnedObjectSize) {
		this.returnedObjectSize = returnedObjectSize;
	}

	public String getClientStr() {
		return clientStr;
	}

	public void setClientStr(String clientStr) {
		this.clientStr = clientStr;
	}

	public Timestamp getFormatedTime() {
		return formatedTime;
	}

}
